package com.caigou.service;

import com.caigou.bean.cms.entity.Picture;
import com.caigou.bean.cms.entity.PictureFolder;
import com.caigou.bean.cms.param.PictureFolderParam;
import com.caigou.bean.cms.param.PictureQueryParam;
import com.caigou.bean.cms.param.PictureRecycleQueryParam;
import com.caigou.bean.cms.param.PictureUseParam;
import com.caigou.bean.exam.entity.Users;
import com.caigou.util.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface PictureService {

    /************************ pictureFolder interface *********************/
    PageInfo<Picture> queryPictureByFolderId(Integer folderId, String keyword, Integer pageNum, Integer paseSize);

    PageInfo<Picture> queryPictureIncludingSubfolders(Integer folderId, String keyword, Integer pageNum, Integer pageSize);

    PageInfo<Picture> queryPictureIncludingSubfolders(PictureQueryParam pictureQueryParam, Users user);

    List<PictureFolder> listPictureFolderBySuperId(Integer superId, String userId);

    Result createPictureFolder(PictureFolderParam param, String userId);

    PictureFolder getRootPictureFolder();

//    int createPersonalRootPictureFolder(String userId, PictureFolder rootPictureFolder);

    PictureFolder getPictureFolder(Integer id);

    Result deletePictureFolder(Integer id);

    PictureFolder getDefaultPictureFolder();

    /************************ picture interface *********************/

    int savePicture(Picture picture);

    Result uploadPicture(MultipartFile[] files, String[] pictureAlts, String[] pictureInfos, Integer folderId,
                         String pictureSource, String photographer, String userId);

    int uploadPicture(MultipartFile file, String pictureAlt, String pictureInfo, int i, Integer folderId,
                      String pictureSource, String photographer, String picFolder, String userId);

    Result deletePicture2Recycle(Integer[] ids);

    Result deletePictureFromRecycle(Integer[] ids);

    Result deletePicture2Recycle(Integer id);

    Result deletePictureFromRecycle(Integer id);

    Result restorePicture(Integer[] ids);

    Result restorePicture(Integer id);

    Result updatePictureName(Integer id, String newPictureName);

    Result updatePictureAlt(Integer id, String newPictureAlt);

    Result updatePictureInfo(Integer id, String newPictureInfo);

    Result updatePhotographer(Integer id, String photographer);

//    Result updatePictureIsUse(Integer id, Integer newPictureIsUse);

    Result movePicture(Integer[] ids, Integer targetFolderId);

    int movePicture(Integer id, Integer targetFolderId);

    Result getPictureTotalSize();

    Result usePicture(PictureUseParam pictureUseParam);

    PageInfo<Picture> queryPictureInRecycle(PictureRecycleQueryParam pictureRecycleQueryParam);

    Result clearRecycle();
}
